<div class="container-fluid">
	<div class="row">
		<div class="col-lg-12">
			<div class="page-header">
				<h1>
					<small><i class="fa fa-phone"></i> Phone Calls</small>
					<div class="pull-right">
						<%= link_to "<i class='fa fa-plus'></i> New Call".html_safe, new_phone_call_path, class: "btn btn-warning btn-sm" %>
					</div>
				</h1>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-lg-offset-1 col-lg-10">
			<table class="table table-striped table-hover">
				<tr class="warning">
					<th></th>
					<th>Name</th>
					<th>Call From</th>
					<th>Call To</th>
					<th>Related To</th>
					<th>Call Type</th>
					<th>Actions</th>
				</tr>
				<% @phone_calls.each do |call| %>
					<tr>
						<td></td>
						<td><a href="#" onclick="get_click(<%= call.id %>);"><%= call.name %></a></td>
						<td><%= call.call_form %></td>
						<td><%= call.call_to %></td>
						<td><%= call.related_to %></td>
						<td><%= call.call_type_name %></td>
						<td>
							<%= link_to content_tag(:i,nil, class: 'fa fa-pencil'), edit_phone_call_path(call), class: "btn btn-success btn-xs table-actions" %>
							<%#= link_to content_tag(:i,nil, class: 'fa fa-eye'), phone_call_path(call), class: "btn btn-info btn-xs table-actions" %>
							<%= link_to content_tag(:i,nil, class: 'fa fa-trash'), call, class: "btn btn-danger btn-xs table-actions", method: :delete %>
						</td>
					</tr>
				<% end %>
			</table>
		</div>
	</div>	
</div>

<script type="text/javascript">
	function get_click(call){
	$('#view_call').modal({
  	 remote: "/phone_calls/view_call?id=" + call
	});
	$('#view_call').on('hidden.bs.modal', function () {
 	location.reload();
	})
	}
</script>

<div class="modal fade" id="view_call" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
    </div>
  </div>
</div>